import {
	myRequest,
	baseURL
} from './http.js'

// 登录
export const authLogin = (config) => {
	return myRequest({
		url: `/v2/wechat/auth_login`,
		method: 'get',
		data: config
	})
}

// 获取活动信息
export const threadInfo = (id, config) => {
	return myRequest({
		url: `/v2/vote/get_thread/${id}`,
		method: 'get',
		data: config
	})
}

// 投票
export const vote = (config) => {
	return myRequest({
		url: `/v2/vote/vote`,
		method: 'post',
		data: config
	})
}

// 获取参投列表
export const voteList = (id, config) => {
	return myRequest({
		url: `/v2/vote/get_vote_item_list/${id}`,
		method: 'get',
		data: config
	})
}

// 获取投票排行榜
export const voteRanking = (id, config) => {
	return myRequest({
		url: `/v2/vote/ranking/${id}`,
		method: 'get',
		data: config
	})
}

// 获取店铺详情
export const voteItem = (id, config) => {
	return myRequest({
		url: `/v2/vote/get_vote_item/${id}`,
		method: 'get',
		data: config
	})
}

// 我的投票
export const myVoteList = (config) => {
	return myRequest({
		url: `/v2/vote/my_record`,
		method: 'get',
		data: config
	})
}

// 我的信息
export const myInfo = () => {
	return myRequest({
		url: `/user`,
		method: 'get'
	})
}

// 图片上传
export const uploadImg = () => {
	return `${baseURL}/upload/image`
}

// 修改个人信息
export const myInfoEdit = (config) => {
	return myRequest({
		url: `/user/edit`,
		method: 'post',
		data: config
	})
}